<template>
  <div class="login-wrap">
    <div class="left-context">
      <img
        src="../assets/img/undraw_my_password_re_ydq7_1.png"
        alt=""
        class="login-img"
      />
    </div>
    <div class="right-context">
      <div class="context-text">重置密码</div>
      <div class="context-login">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm">
          密码
          <el-form-item prop="password">
            <el-input
              type="password"
              v-model="ruleForm.password"
              style="margin-top: 5px"
            >
              <i
                slot="suffix"
                :class="[flag ? 'el-icon-view' : 'el-icon-minus']"
                style="margin-top: 8px; font-size: 18px"
                autocomplete="auto"
                @click="flag = !flag"
              />
            </el-input>
          </el-form-item>
          重复密码
          <el-form-item prop="password">
            <el-input
              type="password"
              v-model="ruleForm.password"
              style="margin-top: 5px"
            >
              <i
                slot="suffix"
                :class="[flag1 ? 'el-icon-view' : 'el-icon-minus']"
                style="margin-top: 8px; font-size: 18px"
                autocomplete="auto"
                @click="flag1 = !flag1"
              />
            </el-input>
          </el-form-item>

          <el-form-item style="width: 100%">
            <el-button size="medium" type="primary" class="submit-btn"
              >登录</el-button
            >
          </el-form-item>
        </el-form>
      </div>
      <div class="jump-register">
        没有账号
        <el-button type="text" style="margin-right: 20px" @click="registerForm"
          >用户注册</el-button
        >
        已有账号
        <el-button type="text" @click="loginForm">用户登录</el-button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data: function () {
    return {
      flag: false,
      flag1: false,
      ruleForm: {
        password: "",
      },
      rules: {
        password: [{ required: true, message: "请输入密码", trigger: "blur" }],
      },
    };
  },
  methods: {
    registerForm() {
      this.$router.push("/register");
    },
    loginForm() {
      this.$router.push("/");
    },
  },
};
</script>
<style scoped>
.login-wrap {
  width: 1024px;
  height: 600px;
  margin: 6% 0 0 20%;
  background-color: #fff;
}
.login-img {
  width: 300px;
  height: 260px;
  margin: 180px 0 0 120px;
}
.left-context {
  float: left;
  width: 512px;
  height: 600px;
  background-color: #9a9aeb;
}
.right-context {
  position: relative;
  float: right;
  width: 512px;
  height: 600px;
}
.context-text {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-top: 80px;
}
.context-login {
  position: absolute;
  width: 350px;
  height: 220px;
  margin-left: 95px;
  margin-top: 40px;
}
.submit-btn {
  width: 100%;
  background-color: #1e1e1e;
  border-radius: 5px;
}
.jump-register {
  margin: 280px 0 0 130px;
  font-size: 14px;
}
</style>
